<template>
  <div id="app">
    <img alt="Vue logo" src="./assets/logo.png">
    <hr>
<!--    <HelloWorld msg="Welcome to Your Vue.js App"/>-->
<!--    <MyFather></MyFather>-->
    <div>
        <router-link to="/myadmin/1111" tag="button">主页</router-link>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <router-link to="/myinfo/zs" tag="a">个人中心</router-link>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <router-link to="/redirect/" tag="a">重定向</router-link>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <span @click.prevent="toNote">公告</span>
    </div>
    <router-view/>
  </div>
</template>

<script>
import HelloWorld from './components/HelloWorld.vue'
import MyFather from "@/components/MyFather.vue";

export default {
  name: 'App',
  components: {
    MyFather,
    HelloWorld
  },
  methods:{
    toNote(){
      const currentRoute = this.$router.currentRoute;
      if (currentRoute.path !== '/note') {
        this.$router.push({
          path:"/note",
          //编程路由参数传递
          query:{
            password:"1234567890"

          }
        })
      }
    }}
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
